<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:include page="../template/header.jsp" />

<jsp:include page="../template/staffmenu.jsp" />

<%-- content template --%>
<jsp:include page="../template/contentheader.jsp" />
<%-- put content here --%>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<fmt:setBundle basename="staff" />

<c:set var="t" value="true" />
<form
	action="/LeaveApplicationProcessingSystem/ManageDetailLeaveServlet"
	method="post">
	<h1>
		<fmt:message key="label.apply.managestaff" />
	</h1>
	<table>
		<tr>
			<td>&nbsp;</td>
			<td><input type="hidden" name="id" value="${param['id']}" />
			</td>
		</tr>
		<tr>
			<td><fmt:message key="lable.staff.id" /></td>
			<td>${param['id']}</td>
		</tr>
		<tr>
			<td><fmt:message key="lable.staff.name" /></td>
			<td>${param['name']}</td>
		</tr>
		<tr>

			<td><fmt:message key="lable.leave.type" />
			</td>
			<c:if test="${param['leaveType'] == 1}">
				<td>Annual</td>
			</c:if>
			<c:if test="${param['leaveType'] == 2}">
				<td>Medical</td>
			</c:if>
			<c:if test="${param['leaveType'] == 3}">
				<td>Compensation</td>
			</c:if>
		</tr>

		<tr>
			<td><fmt:message key="label.apply.sDate" /></td>
			<td>${param['startDate']}</td>
		</tr>

		<tr>
			<td><fmt:message key="label.apply.eDate" /></td>
			<td>${param['endDate']}</td>
		</tr>

		<tr>
			<td><fmt:message key="lable.leave.natureofleave" /></td>
			<td>${param['natureOfLeave']}</td>
		</tr>

		<tr>
			<td><fmt:message key="label.apply.reason" /></td>
			<td>${param['reason']}</td>
		</tr>

		<tr>
			<td><fmt:message key="label.apply.workdissemenation" /></td>
			<td>${param['workDisemmination']}</td>
		</tr>

		<tr>
			<td><fmt:message key="label.apply.contact" /></td>
			<td>${param['contactDetails']}</td>
		</tr>
		<tr>
		<tr>
			<td><fmt:message key="lable.leave.status" /></td>
			<c:if test="${param['status'] == 1}">
				<td>Approved</td>
			</c:if>
			<c:if test="${param['status'] == 2}">
				<td>Applied</td>
			</c:if>
			<c:if test="${param['status'] == 3}">
				<td>Canceled</td>
			</c:if>
			<c:if test="${param['status'] == 4}">
				<td>Rejected</td>
			</c:if>
			<c:if test="${param['status'] == 5}">
				<td>Updated</td>
			</c:if>
		</tr>
		<c:if
			test="${param.status != 4 && param.status != 3 && param.status != 1}">
			<tr>
				<td><fmt:message key="lable.leave.comment" /></td>
				<td height="50"><textarea name="comment"></textarea></td>
			</tr>
		</c:if>
		<c:if
			test="${param.status == 4 || param.status == 3 || param.status == 1}">
			<tr>
				<td><fmt:message key="lable.leave.comment" /></td>
				<td><c:out value="${param.comment}"></c:out></td>
			</tr>
		</c:if>

		<!-- 	<tr>
			<td><fmt:message key="lable.leave.numberofdays" />
			</td>
			<td>${leave.numberOfDays}</td>
		</tr>
-->
		<tr>
			<td></td>
			<td></td>
		</tr>
	</table>

	<c:if
		test="${sessionScope.ismanager == true && param.status != 4 && param.status != 3 && param.status != 1}">
		<input type="submit" value="Approve" name="btnApply" />
		<input type="submit" value="Reject" name="btnClear" />
	</c:if>
	<br />
	<a href="${param.back}"><fmt:message key="lable.staff.back" />
	</a>

</form>

<jsp:include page="../template/contentfooter.jsp" />
<%-- end of content template --%>

<jsp:include page="../template/footer.jsp" />


